﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>

</body>
</html>
V_TableField
SELECT     NEWID() AS TableFieldID, NEWID() AS TableID, EntityName AS TableName, EntityDesc AS Notes, ColSeq AS Sort, ColName AS FieldName, Mark, PKey, 
                      CType AS FiledType, Length, JLength, XLength, CanNull, VDefault, ColDesc, CreateTime, EditTime
FROM         (SELECT     TOP (100) PERCENT CAST(d.name AS varchar) AS EntityName, CAST(f.value AS nvarchar) AS EntityDesc, CAST(a.colorder AS int) AS ColSeq, 
                                              CAST(a.name AS nvarchar) AS ColName, CAST(CASE WHEN COLUMNPROPERTY(a.id, a.name, 'IsIdentity') 
                                              = 1 THEN 'Y' ELSE 'N' END AS char) AS Mark, CAST(CASE WHEN EXISTS
                                                  (SELECT     1
                                                    FROM          dbo.sysindexes si INNER JOIN
                                                                           dbo.sysindexkeys sik ON si.id = sik.id AND si.indid = sik.indid INNER JOIN
                                                                           dbo.syscolumns sc ON sc.id = sik.id AND sc.colid = sik.colid INNER JOIN
                                                                           dbo.sysobjects so ON so.name = si.name AND so.xtype = 'PK'
                                                    WHERE      sc.id = a.id AND sc.colid = a.colid) THEN 'Y' ELSE 'N' END AS char) AS PKey, CAST(b.name AS varchar) AS CType, 
                                              CAST(a.length AS int) AS Length, CAST(COLUMNPROPERTY(a.id, a.name, 'PRECISION') AS int) AS JLength, 
                                              CAST(ISNULL(COLUMNPROPERTY(a.id, a.name, 'Scale'), 0) AS int) AS XLength, 
                                              CAST(CASE WHEN a.isnullable = 1 THEN 'Y' ELSE 'N' END AS char) AS CanNull, CAST(ISNULL(e.text, N'') AS varchar) AS VDefault, 
                                              CAST(ISNULL(g.value, N'') AS nvarchar) AS ColDesc, CAST(d.crdate AS datetime) AS CreateTime, 
                                              CAST(CASE WHEN a.colorder = 1 THEN d .refdate ELSE NULL END AS datetime) AS EditTime
                       FROM          dbo.syscolumns AS a LEFT OUTER JOIN
                                              dbo.systypes AS b ON a.xtype = b.xusertype INNER JOIN
                                              dbo.sysobjects AS d ON a.id = d.id AND d.xtype = 'U' AND d.status >= 0 LEFT OUTER JOIN
                                              dbo.syscomments AS e ON a.cdefault = e.id LEFT OUTER JOIN
                                              sys.extended_properties AS g ON a.id = g.major_id AND a.colid = g.minor_id AND g.name = 'MS_Description' LEFT OUTER JOIN
                                              sys.extended_properties AS f ON d.id = f.major_id AND f.minor_id = 0 AND f.name = 'MS_Description'
                       ORDER BY d.name, ColSeq) AS a_1



V_TableInfoStruc


                       SELECT     NEWID() AS OID, EntityName AS TableName, EntityDesc AS TableNotes, ColSeq AS Sort, ColName, Mark, PKey, CType, Length, JLength, XLength, 
                      CanNull, VDefault, ColDesc, CreateTime, EditTime
FROM         (SELECT     TOP (100) PERCENT CAST(d.name AS varchar) AS EntityName, CAST(f.value AS nvarchar) AS EntityDesc, CAST(a.colorder AS int) AS ColSeq, 
                                              CAST(a.name AS nvarchar) AS ColName, CAST(CASE WHEN COLUMNPROPERTY(a.id, a.name, 'IsIdentity') 
                                              = 1 THEN 'Y' ELSE 'N' END AS char) AS Mark, CAST(CASE WHEN EXISTS
                                                  (SELECT     1
                                                    FROM          dbo.sysindexes si INNER JOIN
                                                                           dbo.sysindexkeys sik ON si.id = sik.id AND si.indid = sik.indid INNER JOIN
                                                                           dbo.syscolumns sc ON sc.id = sik.id AND sc.colid = sik.colid INNER JOIN
                                                                           dbo.sysobjects so ON so.name = si.name AND so.xtype = 'PK'
                                                    WHERE      sc.id = a.id AND sc.colid = a.colid) THEN 'Y' ELSE 'N' END AS char) AS PKey, CAST(b.name AS varchar) AS CType, 
                                              CAST(a.length AS int) AS Length, CAST(COLUMNPROPERTY(a.id, a.name, 'PRECISION') AS int) AS JLength, 
                                              CAST(ISNULL(COLUMNPROPERTY(a.id, a.name, 'Scale'), 0) AS int) AS XLength, 
                                              CAST(CASE WHEN a.isnullable = 1 THEN 'Y' ELSE 'N' END AS char) AS CanNull, CAST(ISNULL(e.text, N'') AS varchar) AS VDefault, 
                                              CAST(ISNULL(g.value, N'') AS nvarchar) AS ColDesc, CAST(d.crdate AS datetime) AS CreateTime, 
                                              CAST(CASE WHEN a.colorder = 1 THEN d .refdate ELSE NULL END AS datetime) AS EditTime
                       FROM          dbo.syscolumns AS a LEFT OUTER JOIN
                                              dbo.systypes AS b ON a.xtype = b.xusertype INNER JOIN
                                              dbo.sysobjects AS d ON a.id = d.id AND d.xtype = 'U' AND d.status >= 0 LEFT OUTER JOIN
                                              dbo.syscomments AS e ON a.cdefault = e.id LEFT OUTER JOIN
                                              sys.extended_properties AS g ON a.id = g.major_id AND a.colid = g.minor_id AND g.name = 'MS_Description' LEFT OUTER JOIN
                                              sys.extended_properties AS f ON d.id = f.major_id AND f.minor_id = 0 AND f.name = 'MS_Description'
                       ORDER BY d.name, ColSeq) AS a_1